package com.example.designpatterns.Interpreter;

/**
 * 加法解释器
 */
public class AddExpression implements Expression {

    public Expression left;
    public Expression right;

    public AddExpression(Expression left, Expression right) {
        this.left = left;
        this.right = right;
    }

    @Override
    public int interpret() {
        return this.left.interpret() + this.right.interpret();
    }
}